home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Picker.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  3.2 KB  |  116 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Picker.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __PICKER__
  13. #define __PICKER__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. /*    #include <QuickdrawText.h>                                    */
  22. /*        #include <IntlResources.h>                                */
  23. #endif
  24.  
  25. enum  {
  26. /*Maximum small fract value, as long*/
  27.     MaxSmallFract                = 0x0000FFFF
  28. };
  29.  
  30.  
  31. /* A SmallFract value is just the fractional part of a Fixed number,
  32. which is the low order word.  SmallFracts are used to save room,
  33. and to be compatible with Quickdraw's RGBColor.  They can be
  34. assigned directly to and from INTEGERs. */
  35.  
  36.  
  37. /* Unsigned fraction between 0 and 1 */
  38.  
  39. typedef unsigned short SmallFract;
  40.  
  41.  
  42. /* For developmental simplicity in switching between the HLS and HSV
  43. models, HLS is reordered into HSL. Thus both models start with
  44. hue and saturation values; value/lightness/brightness is last. */
  45.  
  46. #if defined(powerc) || defined (__powerc)
  47. #pragma options align=mac68k
  48. #endif
  49. struct HSVColor {
  50.     SmallFract                    hue;                            /*Fraction of circle, red at 0*/
  51.     SmallFract                    saturation;                        /*0-1, 0 for gray, 1 for pure color*/
  52.     SmallFract                    value;                            /*0-1, 0 for black, 1 for max intensity*/
  53. };
  54. #if defined(powerc) || defined(__powerc)
  55. #pragma options align=reset
  56. #endif
  57.  
  58. typedef struct HSVColor HSVColor;
  59.  
  60. #if defined(powerc) || defined (__powerc)
  61. #pragma options align=mac68k
  62. #endif
  63. struct HSLColor {
  64.     SmallFract                    hue;                            /*Fraction of circle, red at 0*/
  65.     SmallFract                    saturation;                        /*0-1, 0 for gray, 1 for pure color*/
  66.     SmallFract                    lightness;                        /*0-1, 0 for black, 1 for white*/
  67. };
  68. #if defined(powerc) || defined(__powerc)
  69. #pragma options align=reset
  70. #endif
  71.  
  72. typedef struct HSLColor HSLColor;
  73.  
  74. #if defined(powerc) || defined (__powerc)
  75. #pragma options align=mac68k
  76. #endif
  77. struct CMYColor {
  78.     SmallFract                    cyan;
  79.     SmallFract                    magenta;
  80.     SmallFract                    yellow;
  81. };
  82. #if defined(powerc) || defined(__powerc)
  83. #pragma options align=reset
  84. #endif
  85.  
  86. typedef struct CMYColor CMYColor;
  87.  
  88. #ifdef __cplusplus
  89. extern "C" {
  90. #endif
  91.  
  92. extern pascal SmallFract Fix2SmallFract(Fixed f)
  93.  THREEWORDINLINE(0x3F3C, 0x0001, 0xA82E);
  94. extern pascal Fixed SmallFract2Fix(SmallFract s)
  95.  THREEWORDINLINE(0x3F3C, 0x0002, 0xA82E);
  96. extern pascal void CMY2RGB(const CMYColor *cColor, RGBColor *rColor)
  97.  THREEWORDINLINE(0x3F3C, 0x0003, 0xA82E);
  98. extern pascal void RGB2CMY(const RGBColor *rColor, CMYColor *cColor)
  99.  THREEWORDINLINE(0x3F3C, 0x0004, 0xA82E);
  100. extern pascal void HSL2RGB(const HSLColor *hColor, RGBColor *rColor)
  101.  THREEWORDINLINE(0x3F3C, 0x0005, 0xA82E);
  102. extern pascal void RGB2HSL(const RGBColor *rColor, HSLColor *hColor)
  103.  THREEWORDINLINE(0x3F3C, 0x0006, 0xA82E);
  104. extern pascal void HSV2RGB(const HSVColor *hColor, RGBColor *rColor)
  105.  THREEWORDINLINE(0x3F3C, 0x0007, 0xA82E);
  106. extern pascal void RGB2HSV(const RGBColor *rColor, HSVColor *hColor)
  107.  THREEWORDINLINE(0x3F3C, 0x0008, 0xA82E);
  108. extern pascal Boolean GetColor(Point where, ConstStr255Param prompt, const RGBColor *inColor, RGBColor *outColor)
  109.  THREEWORDINLINE(0x3F3C, 0x0009, 0xA82E);
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113.  
  114. #endif
  115.  
  116.